/**
 * Friends Circle Styles - 朋友圈样式
 * 仿照QQ空间和微信朋友圈设计，简约优雅，符合女性化审美
 * 响应式设计，避免过大间距，保持简洁布局
 */

/* 朋友圈页面主容器 */
.friends-circle-page {
  width: 100%;
  height: 100%;
  background: #ffffff;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

/* 朋友圈内容区域 */
.friends-circle-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding-bottom: 60px; /* 为tab-switcher预留空间 */
}

/* 用户信息区域 */
.user-info-section {
  background: linear-gradient(135deg, #cec5c0 0%, #cebaab 100%);
  color: #333;
  padding: 15px;
  margin-bottom: 8px;
  position: relative;
}

.user-cover {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.user-signature {
  font-size: 13px;
  opacity: 0.9;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
}

.user-signature:hover {
  background: rgba(255, 255, 255, 0.2);
}

.signature-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signature-edit-icon {
  font-size: 11px;
  opacity: 0.7;
}

/* 朋友圈容器 */
.circles-container {
  padding: 0 12px 12px;
  flex: 1;
}

/* 空状态 */
.empty-circles {
  text-align: center;
  padding: 40px 20px;
  color: #999;
  font-size: 14px;
}

.empty-circles i {
  font-size: 32px;
  margin-bottom: 12px;
  display: block;
  color: #ddd;
}

/* 朋友圈卡片 */
.circle-item {
  background: white;
  border-radius: 12px;
  margin-bottom: 8px;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
}

.circle-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 朋友圈头部 */
.circle-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.friend-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.friend-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.friend-info {
  flex: 1;
  min-width: 0;
}

.friend-name {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 2px;
}

.circle-time {
  font-size: 11px;
  color: #999;
}

/* 朋友圈内容 */
.circle-content {
  margin-bottom: 10px;
  line-height: 1.5;
}

.text-circle-content {
  font-size: 14px;
  color: #333;
  word-wrap: break-word;
}

.visual-circle-content {
  font-size: 14px;
  color: #333;
}

.image-placeholder {
  background: linear-gradient(135deg, #cec5c0 0%, #cebaab 100%);
  color: #333;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  min-height: 120px;
  justify-content: center;
}

.image-placeholder i {
  font-size: 24px;
  opacity: 0.9;
}

.image-placeholder .image-description {
  font-size: 13px;
  opacity: 0.9;
  line-height: 1.4;
  text-align: center;
  max-width: 100%;
  word-wrap: break-word;
}

.visual-circle-content .text-content {
  font-size: 14px;
  color: #333;
  line-height: 1.5;
  margin-bottom: 8px;
  word-wrap: break-word;
}

.text-circle-content .text-content {
  margin-top: 8px;
}

/* 操作按钮区域 */
.circle-actions {
  margin-bottom: 8px;
}

.actions-bar {
  display: flex;
  gap: 16px;
  align-items: center;
}

.action-btn {
  background: none;
  border: none;
  color: #666;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background: #f5f5f5;
  color: #333;
}

.action-btn.like-btn.liked,
.action-btn.like-btn .fas.fa-heart.liked {
  color: #ff6b9d;
}

.action-btn i {
  font-size: 13px;
}

.like-count {
  font-size: 12px;
  min-width: 16px;
  text-align: left;
}

/* 点赞动画 */
.liked-animation {
  animation: likeAnimation 0.3s ease;
}

@keyframes likeAnimation {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

/* 回复区域 */
.replies-section {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 8px;
  margin-top: 8px;
}

.replies-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.circle-reply {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.reply-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.reply-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reply-content {
  flex: 1;
  min-width: 0;
}

.reply-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
  justify-content: space-between;
}

.reply-author {
  font-size: 12px;
  font-weight: 600;
  color: #333;
}

.reply-time {
  font-size: 10px;
  color: #999;
}

.reply-to-comment-btn {
  background: none;
  border: none;
  color: #999;
  font-size: 10px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
  opacity: 0.7;
}

.reply-to-comment-btn:hover {
  background: #f0f0f0;
  color: #9291a3;
  opacity: 1;
}

.reply-to-comment-btn i {
  font-size: 10px;
}

.reply-text {
  font-size: 12px;
  color: #555;
  line-height: 1.4;
  word-wrap: break-word;
}

/* 回复输入框 */
.reply-input-container {
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px;
  background: #f8f9fa;
  border-radius: 8px;
}

.reply-input {
  flex: 1;
  border: 1px solid #e1e5e9;
  border-radius: 16px;
  padding: 6px 12px;
  font-size: 13px;
  outline: none;
  background: white;
  transition: border-color 0.2s ease;
}

.reply-input:focus {
  border-color: #9291a3;
}

.reply-send-btn {
  background: #9291a3;
  color: white;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.reply-send-btn:hover {
  background: #5a6fd8;
  transform: scale(1.05);
}

.reply-send-btn i {
  font-size: 11px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .friends-circle-page {
    padding: 0;
  }

  .user-info-section {
    padding: 12px;
  }

  .user-cover {
    gap: 10px;
  }

  .user-avatar {
    width: 45px;
    height: 45px;
  }

  .user-name {
    font-size: 15px;
  }

  .user-signature {
    font-size: 12px;
  }

  .circles-container {
    padding: 0 8px 8px;
  }

  .circle-item {
    padding: 10px;
    margin-bottom: 6px;
  }

  .friend-avatar {
    width: 32px;
    height: 32px;
  }

  .friend-name {
    font-size: 13px;
  }

  .text-circle-content,
  .visual-circle-content {
    font-size: 13px;
  }

  .image-placeholder {
    padding: 16px;
  }

  .actions-bar {
    gap: 12px;
  }

  .action-btn {
    font-size: 11px;
    padding: 3px 6px;
  }
}

/* 确保在所有宽度下保持一致的最大宽度 */
@media (min-width: 769px) {
  .friends-circle-page {
    max-width: 100%;
  }

  .circle-item {
    max-width: none;
  }

  .user-info-section {
    max-width: none;
  }
}

/* 防止组件过大的限制 */
.circle-item,
.user-info-section {
  box-sizing: border-box;
}

.circle-content,
.reply-text,
.text-circle-content {
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* 底部切换栏样式 */
.message-tab-switcher {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #cec5c0;
  border-top: 1px solid #cebaab;
  display: flex;
  height: 35px;
  z-index: 100;
  box-shadow: 0 -2px 8px rgba(206, 197, 192, 0.3);
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #9291a3;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 6px 8px;
}

.tab-btn:hover {
  background: #cebaab;
  color: white;
}

.tab-btn.active {
  color: white;
  background: #9291a3;
}

.tab-btn i {
  font-size: 14px;
}

.tab-btn span {
  font-size: 11px;
  font-weight: 500;
}

/* 朋友圈页面和消息应用容器 */
.friends-circle-page,
.messages-app {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

/* 朋友圈加载状态 */
.friends-circle-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #999;
}

.loading-spinner {
  font-size: 32px;
  margin-bottom: 16px;
  color: #9291a3;
}

.loading-text {
  font-size: 14px;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .message-tab-switcher {
    height: 30px;
  }

  .tab-btn {
    padding: 4px 6px;
    gap: 3px;
    font-size: 10px;
  }

  .tab-btn i {
    font-size: 12px;
  }

  .tab-btn span {
    font-size: 10px;
  }
}

@media (max-width: 480px) {
  .message-tab-switcher {
    height: 28px;
  }

  .tab-btn {
    padding: 3px 4px;
    gap: 2px;
    font-size: 9px;
  }

  .tab-btn i {
    font-size: 11px;
  }

  .tab-btn span {
    font-size: 9px;
  }
}

/* 发布弹窗样式 */
.friends-circle-publish-modal,
.friends-circle-text-publish-modal,
.friends-circle-image-publish-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  max-width: 90%;
  max-height: 80%;
  overflow: hidden;
  animation: modalSlideIn 0.3s ease;
  pointer-events: auto;
  z-index: 10001;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #cebaab;
  background: linear-gradient(135deg, #cec5c0 0%, #9291a3 100%);
  color: white;
}

.modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: background 0.2s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* 发布选项 */
.publish-options {
  padding: 24px;
  display: flex;
  gap: 16px;
  justify-content: center;
}

.publish-option-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 24px;
  background: linear-gradient(135deg, #cebaab 0%, #cec5c0 100%);
  color: #333;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 80px;
}

.publish-option-btn:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #9291a3 0%, #cebaab 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(146, 145, 163, 0.4);
}

.publish-option-btn i {
  font-size: 24px;
}

.publish-option-btn span {
  font-size: 13px;
  font-weight: 500;
}

/* 发布表单 */
.modal-body {
  padding: 20px;
  max-height: 400px;
  overflow-y: auto;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
}

.text-input,
.image-desc-input {
  width: 100%;
  min-height: 80px;
  padding: 12px;
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  font-size: 14px;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.text-input:focus,
.image-desc-input:focus {
  border-color: #9291a3;
}

.file-input {
  width: 100%;
  padding: 8px;
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}

.file-hint {
  font-size: 11px;
  color: #999;
  margin-top: 4px;
}

.char-count {
  text-align: right;
  font-size: 11px;
  color: #999;
  margin-top: 4px;
}

/* 弹窗底部 */
.modal-footer {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid #e1e5e9;
  background: #f8f9fa;
  justify-content: flex-end;
}

.cancel-btn,
.send-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cancel-btn {
  background: #e9ecef;
  color: #666;
}

.cancel-btn:hover {
  background: #dee2e6;
}

.send-btn {
  background: #9291a3;
  color: white;
}

.send-btn:hover {
  background: #cebaab;
  color: #333;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .modal-content {
    max-width: 95%;
    max-height: 90%;
  }

  .modal-header {
    padding: 12px 16px;
  }

  .modal-header h3 {
    font-size: 15px;
  }

  .publish-options {
    padding: 20px 16px;
    gap: 12px;
  }

  .publish-option-btn {
    padding: 16px 20px;
    min-width: 70px;
  }

  .publish-option-btn i {
    font-size: 20px;
  }

  .publish-option-btn span {
    font-size: 12px;
  }

  .modal-body {
    padding: 16px;
    max-height: 300px;
  }

  .text-input,
  .image-desc-input {
    min-height: 60px;
    padding: 10px;
    font-size: 13px;
  }

  .modal-footer {
    padding: 12px 16px;
  }
}

/* 附件上传区域样式 */
.attachment-upload-area {
  width: 100%;
}

.file-drop-zone {
  border: 2px dashed #ddd;
  border-radius: 8px;
  padding: 30px 20px;
  text-align: center;
  background: #fafafa;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.file-drop-zone:hover {
  border-color: #9291a3;
  background: #f0f8ff;
}

.file-drop-zone.drag-over {
  border-color: #9291a3;
  background: #e3f2fd;
  transform: scale(1.02);
}

.drop-zone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.drop-zone-content i {
  font-size: 32px;
  color: #9291a3;
  margin-bottom: 8px;
}

.upload-text {
  font-size: 14px;
  color: #333;
  font-weight: 500;
}

.upload-hint {
  font-size: 12px;
  color: #666;
}

.hidden-file-input {
  display: none;
}

/* 图片预览区域 */
.image-preview-area {
  margin-top: 15px;
  padding: 15px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #f9f9f9;
}

.preview-image-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.preview-image {
  max-width: 100%;
  max-height: 200px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  object-fit: contain;
}

.remove-image-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ff4757;
  color: white;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.remove-image-btn:hover {
  background: #ff3742;
  transform: scale(1.1);
}

.image-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #666;
}

.image-name {
  font-weight: 500;
  color: #333;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-size {
  color: #999;
}

/* 上传状态 */
.upload-status {
  margin-top: 15px;
  padding: 15px;
  border: 1px solid #e3f2fd;
  border-radius: 8px;
  background: #f3f9ff;
}

.upload-progress {
  width: 100%;
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #9291a3, #cebaab);
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 0%;
}

.upload-text {
  font-size: 14px;
  color: #9291a3;
  text-align: center;
  font-weight: 500;
}

/* 朋友圈真实图片样式 - 响应式设计 */
.circle-image-container {
  width: 100%;
  margin: 12px 0;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.circle-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  cursor: pointer;
  object-fit: contain;
  transition: transform 0.3s ease;
  display: block;
}

.circle-image:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* 手机端朋友圈图片优化 */
@media (max-width: 768px) {
  .circle-image-container {
    border-radius: 8px;
    margin: 8px 0;
  }

  .circle-image {
    border-radius: 8px;
  }

  /* 确保图片在手机端完整显示 */
  .visual-circle-content .circle-image-container {
    width: 100%;
    max-width: 100%;
  }

  .visual-circle-content .circle-image {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
  }
}
